<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="language" content="en" />

	<!-- blueprint CSS framework -->
	<!-- <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/screen.css" media="screen, projection" /> -->
	<!-- <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/print.css" media="print" /> -->
	<!--[if lt IE 8]>
	link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css" media="screen, projection" />
	<![endif]-->

	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />
	
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/siteStyles.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/fbStyles.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/styles.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main-styles.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/dhtmlxcombo.css" />
	
	
	
	<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/jquery-1.4.4.min.js"></script>
	<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/jquery-ui-1.8.9.custom.min.js"></script>
	<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/jquery.tablednd_0_5.js"></script>
	
	<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/dhtmlxcommon.js"></script>
	<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/dhtmlxcombo.js"></script>
	
	<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/json-template.js"></script>
	
	<title><?php echo CHtml::encode($this->pageTitle); ?></title>
	
	<script type="text/javascript">
	var Core = window.Core = {};
	
	</script>
	
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/jquery-ui-1.8.11.custom.css" />
</head>

<body>

<?php $controller = Yii::app()->controller->id; ?>
<?php $action = $this->getAction()->getId(); ?>

<div class ="main_bg">

<!-- nav -->
<div id="navmain">
    
	    
	<div class="container ">
		<!-- top links -->
		<ol>
			<li><a href="<?php echo $this->createUrl("settings/profile"); ?>" >Settings</a></li>
			<!--<li><a href="" >Help</a></li>-->
			<?php if (!Yii::app()->user->isGuest) : ?><li><a href="<?php echo $this->createUrl("site/logout"); ?>">Logout</a></li><?php endif; ?>
	    </ol>
	    <!-- end top links -->
	    
	    <div id="subnav-container">
	    	<div style='min-height: 65px;'>
	    		
	    		<h2><span style="color: #ffffff;">CLOVERDALE</span></h2> 
	    		<span style="color: #ffffff;">>> <?php echo Yii::app()->user->getState('organization_name'); ?> <<</span>
	    		
	    		<!--
	    		<img alt="" width="150" id="sysLogo" onload="pngTrans(this);" src="/logo.php/system.v1267656975" height="75" />
				-->
			</div>
	    	<ul>
	    		<li <?php if ($controller == 'dashboard'):?>class="active"<?php endif; ?>><a href="<?php echo $this->createUrl("dashboard/home"); ?>">Dashboard</a></li>
	    		<li <?php if ($controller == 'sales' || $controller == 'customer'
	    						 || $controller == 'salesOrder'):?>class="active"<?php endif; ?>><a href="<?php echo $this->createUrl("salesOrder/index"); ?>">Sales</a></li>
	    		<li <?php if ($controller == 'inventory' || $controller == 'item'
								 || $controller == 'inventoryLocation'): ?>class="active"<?php endif; ?>><a href="<?php echo $this->createUrl("inventory/items"); ?>">Inventory</a></li>
				<li <?php if ($controller == 'vendor' || $controller == 'purchaseOrder'):?>class="active"<?php endif; ?>><a href="<?php echo $this->createUrl("vendor/index"); ?>">Vendors</a></li>
				<li <?php if ($controller == 'manufacturing' || $controller == 'workOrder'
								 || $controller == 'manufacturingLocation'):?>class="active"<?php endif; ?>><a href="<?php echo $this->createUrl("workOrder/index"); ?>">Manufacturing</a></li>
			</ul>

		</div>
		<div class="clearb"></div>
	</div>
</div>

<div id="subnav" >
<div class="container ">
	
	<?php if ($controller == 'dashboard'):?>
	<ul>
		<li <?php if ($action == 'home'):?>class="active"<?php endif; ?>><a href="<?php echo $this->createUrl("dashboard/home"); ?>">Home</a></li>
	</ul>
	<?php elseif ($controller == 'inventory' || $controller == 'item' || $controller == 'itemCategory'):?>
	<ul>
		<li <?php if ($action == 'items' || $controller == 'item'):?>class="active"<?php endif; ?>><a href="<?php echo $this->createUrl("inventory/items"); ?>">Items</a></li>
		<li <?php if ($action == 'locations'):?>class="active"<?php endif; ?>><a href="<?php echo $this->createUrl("inventory/locations"); ?>">Locations</a></li>
		<li <?php if ($action == 'categories' || $controller == 'itemCategory'):?>class="active"<?php endif; ?>><a href="<?php echo $this->createUrl("inventory/categories"); ?>">Categories</a></li>
		
	</ul>
	<?php elseif ($controller == 'vendor' || $controller == 'purchaseOrder'):?>
	<ul>
		<li <?php if ($action == 'index'):?>class="active"<?php endif; ?>><a href="<?php echo $this->createUrl("vendor/index"); ?>">Vendors</a></li>
		<li <?php if ($controller == 'purchaseOrder' || $action == 'purchaseOrders'):?>class="active"<?php endif; ?>><a href="<?php echo $this->createUrl("vendor/purchaseOrders"); ?>">Purchase Orders</a></li>
	</ul>
	<?php elseif ($controller == 'sales' || $controller == 'customer'
					 || $controller == 'salesOrder'):?>
	<ul>
		<li <?php if ($controller == 'sales'):?>class="active"<?php endif; ?>><a href="<?php echo $this->createUrl("sales/index"); ?>">Sales</a></li>
		<li <?php if ($controller == 'salesOrder'):?>class="active"<?php endif; ?>><a href="<?php echo $this->createUrl("salesOrder/index"); ?>">Sales Orders</a></li>
		<li <?php if ($controller == 'customer'):?>class="active"<?php endif; ?>><a href="<?php echo $this->createUrl("customer/index"); ?>">Customers</a></li>
	
	</ul>
	<?php elseif ($controller == 'manufacturing' || $controller == 'workOrder'
					 || $controller == 'manufacturingLocation'):?>
	<ul>
		<li <?php if ($controller == 'workOrder'):?>class="active"<?php endif; ?>><a href="<?php echo $this->createUrl("workOrder/index"); ?>">Work Orders</a></li>
		<li <?php if ($action == 'locations'|| $controller == 'manufacturingLocation'):?>class="active"<?php endif; ?>><a href="<?php echo $this->createUrl("manufacturing/locations"); ?>">Locations</a></li>
	</ul>
	<?php endif; ?>
	
	<div class="clearb"></div>
</div>
</div>

<div class="container">
	<?php $this->widget('zii.widgets.CBreadcrumbs', array(
			'links'=>$this->breadcrumbs,
		)); ?>
</div>

<div class="clearb"></div>

<script type="text/javascript">
function SetAction(x) {
	
	  document.forms[0].form_action.value = x;
	  document.forms[0].submit();

	  return false;
	}

//------------------------------------------------------------------------
function Check_Uncheck(source, targets) {
	
	$source = $(source);
	$targets = $('input[name=' + targets + ']');
	
	if ($source.is(':checked')) {
		alert('checked');
		$targets.attr('checked', true);
	} else {
		$targets.removeAttr('checked');
	}
	return true;
}
//------------------------------------------------------------------------

</script>


<?php echo $content; ?>



</div>
</body>
</html>